<!--<?php
print <<<EOT
-->
<div class="m"></div>
<div class="t">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="tr4"><td colspan="6">
  <input type="button" name="Submit5" value="查看管理员" class="btn" onclick="window.location='$basename';"/>
  <input type="button" name="Submit5" value="增添管理员" class="btn" onclick="window.location='$basename&action=add';"/></td>
</tr>
</table>
</div>
<!--
EOT;
if(!$action){
print <<<EOT
-->
<div class="t">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="head"><td colspan="7">编辑管理员</td></tr>
<tr class="tr2">
  <td width="5%">&nbsp;</td>
  <td>UID</td>
  <td>管理员</td>
  <td>E-mail</td>
  <td>上次登录时间</td>
  <td>登录IP</td>
  <td>管理操作</td>
</tr>
<!--
EOT;
foreach($admindb as $admin){
$delurl = EncodeUrl("$basename&action=del&uid=$admin[uid]");
print <<<EOT
-->
<tr class="tr3">
  <td><img src="images/admin/admin.gif" align="absmiddle" /></td>
  <td>$admin[uid]</td>
  <td>$admin[username]</td>
  <td>$admin[email]</td>
  <td>$admin[logintime]</td>
  <td>$admin[ip]</td>
  <td><a href="$basename&action=edit&uid=$admin[uid]"><img src="images/admin/edit.png" align="absmiddle" alt="编辑" /></a> <a href="$delurl"><img src="images/admin/delete.png" align="absmiddle" alt="删除" /></a>  </td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
</div>
<!--
EOT;
}elseif($action=='edit'){
print <<<EOT
-->
<form action="$basename" method="post">
<div class="t" style="width:50%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="head">
  <td colspan="2">编辑管理员</td>
</tr>
<tr class="line">
  <td width="25%">管理员账号</td>
  <td width="75%"><input name="new_username" type="text" disabled="disabled" class="input" id="new_username" value="$edit[username]" /></td>
</tr>
<tr class="line">
  <td>管理员密码</td>
  <td><input name="new_password" type="text" id="new_password" class="input" />
  (如果不修改清留空)</td>
</tr>
<tr class="line">
  <td>密码确认</td>
  <td><input name="new_password2" type="text" id="new_password2" class="input" /></td>
</tr>
<tr class="line">
  <td>E-mail</td>
  <td><input name="new_email" type="text" class="input" id="new_email" value="$edit[email]" /></td>
</tr>
</table>
</div>
<div class="t" style="width:50%">
<table border="0" cellspacing="0" cellpadding="0">
<tr class="head">
  <td colspan="2">权限设置</td>
  </tr>
<!--
EOT;
foreach($menus as $menu){
print <<<EOT
-->
<tr class="tr2">
  <td colspan="2">$menu[root]</td>
</tr>
<!--
EOT;
foreach($menu as $key=>$title){
if($key != 'root' && $key!='set_creator' && $key!='set_admin'){ 
$ifchecked = in_array($key,$edit[priv])? "checked" : '';
print <<<EOT
-->
<tr class="line">
  <td>$title</td>
  <td><input name="check[$key]" type="checkbox" id="check[$key]" value="1" $ifchecked /></td>
</tr>
<!--
EOT;
}}}print <<<EOT
-->
</table>
</div>
<center>
  <input name="uid" type="hidden" id="uid" value="$edit[uid]" />
  <input name="action" type="hidden" id="action" value="edit" />
  <input name="step" type="hidden" id="step" value="2">
  <input type="submit" name="Submit" value=" 提 交 " class="btn"> 
  <input type="reset" name="Submit2" value=" 重 置 " class="btn">
</center>
</form>
<!--
EOT;
}elseif($action=='add'){
print <<<EOT
-->
<form action="$basename" method="post">
<div class="t" style="width:50%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="head"><td colspan="2">添加管理员</td></tr>
<tr class="line">
  <td width="25%">管理员账号</td>
  <td width="75%"><input name="new_username" type="text" id="new_username" class="input" /></td>
</tr>
<tr class="line">
  <td>管理员密码</td>
  <td><input name="new_password" type="text" id="new_password" class="input" /></td>
</tr>
<tr class="line">
  <td>密码确认</td>
  <td><input name="new_password2" type="text" id="new_password2" class="input" /></td>
</tr>
<tr class="line">
  <td>E-mail</td>
  <td><input name="new_email" type="text" id="new_email" class="input" /></td>
</tr>
</table>
</div>
<div class="t" style="width:50%">
<table border="0" cellspacing="0" cellpadding="0">
<tr class="head">
  <td colspan="2">权限设置</td>
  </tr>
<!--
EOT;
foreach($menus as $menu){
print <<<EOT
-->
<tr class="tr2">
  <td colspan="2">$menu[root]</td>
</tr>
<!--
EOT;
foreach($menu as $key=>$title){
if($key != 'root' && $key!='set_creator' && $key!='set_admin'){
print <<<EOT
-->
<tr class="line">
  <td>$title</td>
  <td><input name="check[$key]" type="checkbox" id="check[$key]" value="1" /></td>
</tr>
<!--
EOT;
}}}print <<<EOT
-->
</table>
</div>
<center>
  <input name="action" type="hidden" id="action" value="add" />
  <input name="step" type="hidden" id="step" value="2">
  <input type="submit" name="Submit" value=" 提 交 " class="btn"> 
  <input type="reset" name="Submit2" value=" 重 置 " class="btn">
</center>
</form>
<!--
EOT;
}
?>-->